using UnityEngine;

namespace FluffyUnderware.Curvy.Generator
{
	public class CGDataRequestRasterization : CGDataRequestParameter
	{
		public enum ModeEnum
		{
			Even,
			Optimized
		}

		public float Start;

		public float RasterizedRelativeLength;

		public int Resolution;

		public float SplineAbsoluteLength;

		public float AngleThreshold;

		public ModeEnum Mode;

		public CGDataRequestRasterization(float start, float rasterizedRelativeLength, int resolution, float splineAbsoluteLength, float angle, ModeEnum mode = ModeEnum.Even)
		{
			Start = Mathf.Repeat(start, 1f);
			RasterizedRelativeLength = Mathf.Clamp01(rasterizedRelativeLength);
			Resolution = resolution;
			SplineAbsoluteLength = splineAbsoluteLength;
			AngleThreshold = angle;
			Mode = mode;
		}

		public CGDataRequestRasterization(CGDataRequestRasterization source)
			: this(source.Start, source.RasterizedRelativeLength, source.Resolution, source.SplineAbsoluteLength, source.AngleThreshold, source.Mode)
		{
		}

		public override bool Equals(object obj)
		{
			CGDataRequestRasterization cGDataRequestRasterization = obj as CGDataRequestRasterization;
			if (cGDataRequestRasterization == null)
			{
				return false;
			}
			return Start == cGDataRequestRasterization.Start && RasterizedRelativeLength == cGDataRequestRasterization.RasterizedRelativeLength && Resolution == cGDataRequestRasterization.Resolution && SplineAbsoluteLength == cGDataRequestRasterization.SplineAbsoluteLength && AngleThreshold == cGDataRequestRasterization.AngleThreshold && Mode == cGDataRequestRasterization.Mode;
		}

		public override int GetHashCode()
		{
			return new
			{
				A = Start,
				B = RasterizedRelativeLength,
				C = Resolution,
				D = AngleThreshold,
				E = Mode,
				F = SplineAbsoluteLength
			}.GetHashCode();
		}
	}
}
